﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcs.Web.fmbug
{
    public partial class Modify : Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    int obid = (Convert.ToInt32(Request.Params["id"]));
                    ShowInfo(obid);
                }
            }
        }

        private void ShowInfo(int obid)
        {
            lcs.BLL.fmbug bll = new lcs.BLL.fmbug();
            lcs.Model.fmbug model = bll.GetModel(obid);
            //this.lblobid.Text = model.obid.ToString();
            hf.Value = model.out_storage_detail_Id.ToString();
            this.txtobcontent.Text = model.obcontent;
            //this.txtinputtime.Text = model.inputtime.ToString();

        }

        public void btnSave_Click(object sender, EventArgs e)
        {

            int out_storage_detail_Id = 0;
            if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
            {
                int.TryParse(Request.Params["id"].Trim(), out out_storage_detail_Id);

                string obcontent = this.txtobcontent.Text;
                DateTime inputtime = DateTime.Now;
                lcs.Model.fmbug model = new lcs.Model.fmbug();
                model.obid = out_storage_detail_Id;
                model.obcontent = obcontent;               
                lcs.BLL.fmbug bll = new lcs.BLL.fmbug();
                bll.Update(model);                       
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "修改成功！", "list.aspx?id=" + hf.Value);
            }
            else
            {
                Maticsoft.Common.MessageBox.Show(this, "参数不对！");

            }



            

        }


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
